-- plunder
-- created by wangy
-- 掠夺

return {
    apply = function(prop, baseValue)
        return prop[3];
    end,

    -- 每回合触发
    trigger = function(who, prop, arg)
        local rand = DungeonM.getRandSeed("plunder") % 1000;
        local rand1 = DungeonM.getRandSeed("plunder") % 100;
        local rand2 = DungeonM.getRandSeed("plunder");

        if rand > prop[3] then
            return;
        end

        local bonus;
        local classId;

        if rand1 >= 20 then
            bonus = { 7363, 7364, 7365, 7366, 7367, };
        else
            bonus = { 7368, 8173, 8174, 8175, };
        end

        classId = FormulaM.invoke("FETCH_BY_RAND", bonus, rand2);

        return { 1, classId, 1};
    end,

    record = function(target, prop, path)
        return false;
    end
};